home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / GridRestore.pprx < prev    next >
Text File  |  1993-05-25  |  959b  |  54 lines

  1. /* This Genie restores the previous size of the grid from a file in ram: if available.
  2. Written by Don Cox  © Feb 93 Not public domain. All rights reserved.  */
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7. address command
  8. call SafeEndEdit.rexx()
  9. call ppm_AutoUpdate(0)
  10. cr="0a"x
  11.  
  12. trace n
  13. currentunits = ppm_GetUnits()
  14.  
  15. gsize = ppm_GetGridSize()
  16. xspacing = 1 /* defaults */
  17. yspacing = 1
  18.  
  19.  
  20. if exists("ram:gridsize") then do
  21.     call open("infile","ram:gridsize")
  22.     gridsize = readln("infile")
  23.     xspacing = word(gridsize,1)
  24.     yspacing = word(gridsize,2)
  25.     end
  26. call ppm_SaveText("ram:gridsize",gsize)
  27. call ppm_SetGridSize(xspacing,yspacing)
  28.  
  29.  
  30. call ppm_SetGrid(1)
  31.  
  32. call ppm_SetGridSnap(1)
  33.  
  34. call exit_msg()
  35.  
  36. end
  37.  
  38. error:
  39. syntax:
  40.     do
  41.     exit_msg("Genie failed due to error: "errortext(rc))
  42.     end
  43.  
  44. exit_msg:
  45.     do
  46.     parse arg message
  47.     if message ~= "" then
  48.     call ppm_Inform(1,message)
  49.     call ppm_ClearStatus()
  50.     call ppm_AutoUpdate(1)
  51.     exit
  52.     end
  53.  
  54.